//线程方法-sleep
//线程方法-sleep
//线程方法-sleep

package learn.day;

public class demo2 {
    public static void main(String[] args) {
        Thread thread=new Thread(()->{
            while(true){
                for(int i=0;i<10;i++){
                    System.out.println("新线程"+i);
                    try {
                        Thread.sleep(1000);
                    } catch (InterruptedException e) {
                        e.printStackTrace();
                    }
                }
            }
        });
        thread.start();
    }
}
